import React, { Component } from 'react';
/*
  学习目标：使用React的props实现具名插槽
  作用域插槽  - 子组件向父组件传数据
  具名插槽 - 父组件向子组件传数据-传多个
*/
export default class App extends Component {
  render() {
    return (
      <div>
        {/* 具名插槽 - 父组件向子组件传数据-传多个 */}
        <Child>{{ title: 'zs', content: '一行白鹭上青天' }}</Child>
      </div>
    );
  }
}

class Child extends React.Component {
  render() {
    const { children } = this.props;
    return (
      <div>
        <h1>Child</h1>
        <h1>title - {children.title}</h1>
        <h2>content - {children.content}</h2>
      </div>
    );
  }
}
